You can search your application's high-level event queue for a specific high-level event by using the GetSpecificHighLevelEvent function (GetSpecificHighLevelEvent) and providing a filter function. Your filter function receives a pointer to a high-level event message structure that contains information about a high-level event.
For information on getting a function descriptor for your filter function, see "Filter Function Pointer and Macro" . For information on how to define a filter function, see "Filter Function for Searching the High-Level Event Queue" .
A structure of type HighLevelEventMsg defines a high-level event message structure.
struct HighLevelEventMsg { /* high-level event message structure */
unsigned short HighLevelEventMsgHeaderLength; /* reserved */
unsigned short version; /* reserved */
unsigned long reserved1; /* reserved */
EventRecord theMsgEvent; /* event record of
/* high-level event */
unsigned long userRefCon; /* user reference
/* constant */
unsigned long postingOptions; /* reserved */
unsigned long msgLength; /* reserved */};
typedef struct HighLevelEventMsg HighLevelEventMsg;
typedef HighLevelEventMsg *HighLevelEventMsgPtr,
**HighLevelEventMsgHandle,
**HighLevelEventMsgHdl;